﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace TileEngine
{
    static class Camera
    {  
        public static Vector2 Location = Vector2.Zero;
        public static Vector2 screenDimension;
        public static Vector2 tilesOnScreen = new Vector2();


        public static void setScreenParameters(int screenX, int screenY)
        {
            screenDimension.X = screenX;    
            screenDimension.Y = screenY;
            tilesOnScreen.X = (int)(screenDimension.X / Global.tileSize.X)+1;
            tilesOnScreen.Y = (int)(screenDimension.Y / Global.tileSize.Y)+1;
        }
        public static Vector2 getCenterPoint()
        {
            return new Vector2(Location.X + screenDimension.X / 2, Location.Y + screenDimension.Y / 2);
        }
        public static void setCenter(Vector2 center)
        {
            Location.X += center.X - getCenterPoint().X;
            Location.Y += center.Y - getCenterPoint().Y;
        }
    }
}
